import { Router } from 'express';
import { authenticate } from '@/middleware/auth';
import {
  createCar,
  getCars,
  getCarById,
  updateCar,
  deleteCar,
} from '@/controllers/vehicleController';

const router = Router();

// 所有车辆路由都需要认证
router.use(authenticate);

// 车辆管理路由
router.post('/', createCar);
router.get('/', getCars);
router.get('/:id', getCarById);
router.put('/:id', updateCar);
router.delete('/:id', deleteCar);

export default router;
